package day09;


import jakarta.servlet.jsp.JspException;
import jakarta.servlet.jsp.JspWriter;
import jakarta.servlet.jsp.PageContext;
import jakarta.servlet.jsp.tagext.SimpleTagSupport;

import java.io.IOException;


//<xxx:msg info="Hello" num=3></xxx:msg>
public class MsgTag extends SimpleTagSupport {

    private String info;
    private int num;

    @Override
    public void doTag() throws JspException, IOException {
        PageContext pageContext= (PageContext) getJspContext();


        JspWriter out=pageContext.getOut();


        for (int i = 0; i < num; i++) {
            out.print("<h1>"+info+"</h1>");
        }

    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }
}
